// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten. You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.service;

import java.util.Date;

/**
 * @see org.tinaelle.service.AdObjectService
 */
public abstract class AdObjectServiceImpl extends org.tinaelle.server.service.AdObjectServiceBase {

	/**
     * 
     */
	private static final long	serialVersionUID	= 1L;

	/**
	 * @see org.tinaelle.service.AdObjectService#preSave(org.tinaelle.dto.AdObjectDTO)
	 */
	@Override
	protected void handlePreSave(final org.tinaelle.common.dto.AdObjectDTO adObjectDTO, final boolean isNew)
	        throws java.lang.Exception {
		/*
		 * if ( Session.get() != null && Session.get().getUser() != null ) connectedUserId =
		 * Session.get().getUser().getAdUserId();
		 */
		if ( adObjectDTO.getClient() == null ) {
			adObjectDTO.setClient( new Integer( 1 ) );
		}
		if ( isNew ) {
			adObjectDTO.setCreated( new Date() );
			adObjectDTO.setCreatedBy( new Integer( 1 ) );
		}
		adObjectDTO.setUpdated( new Date() );
		adObjectDTO.setUpdatedBy( new Integer( 1 ) );
	}
}